<?php
require_once FOREGROUND_COMMON_ACTION_SERVICE_DIR . '/default.php';

class foreground_order_index_action_service extends foreground_default_common_action_service
{
    protected static $_instance;

    public static function get_instance()
    {
        if (null === self::$_instance) {
            self::$_instance = new self();
        }

        return self::$_instance;
    }


    protected function _current_page_process()
    {
        //var_dump(__METHOD__); exit();
        
        $action_data = wwy_action::$data;
	    $session_member_info = $action_data['session_member_info'];
        $member_id = $session_member_info['id'];
    
        $model_foreground_cart = wwy_resource_container::get_model_foreground_cart();
        //var_dump($model_foreground_cart); exit();
        $cart_list_info = $model_foreground_cart->get_cart_list_info($member_id);
        //var_dump($cart_list_info); exit();
        self::add_view_data('cart_list_info', $cart_list_info);
        
        //省列表
        $model_foreground_address_region = wwy_resource_container::get_model_foreground_address_region();
        //var_dump($model_foreground_address_region); exit();
        $province_list = $model_foreground_address_region->get_province_list();
        //var_dump($province_list); exit();
        self::add_view_data('province_list', $province_list);
        
        //用户收货地址列表        
        $model_foreground_member_address = wwy_resource_container::get_model_foreground_member_address();
        //var_dump($model_foreground_member_address); exit();
        $address_list = $model_foreground_member_address->get_address_list($member_id, $province_list);
        //var_dump($address_list); exit();
        self::add_view_data('address_list', $address_list);
    
        //SEO:title,keywords,description
        self::add_view_data('page_title', '下单页面');
    }
}